package com.supply.supplymanage.biz;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.supply.supplymanage.dao.BuyerMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * Created by 15119 on 2018-10-15.
 */
@Service
public class BuyerBizImpl implements BuyerBiz {
    @Resource
    private BuyerMapper buyerMapper;
 public PageInfo getAll(Integer pageNum, String buycode){
     PageHelper.startPage(pageNum,2);
     List<Map> maps = buyerMapper.getAll(buycode);
     PageInfo<Map> pageInfo=new PageInfo<Map>(maps);
     return pageInfo;
 }
 public PageInfo getBuyer(Integer pageNum, String purcode){
     PageHelper.startPage(pageNum,2);
     List<Map> maps = buyerMapper.getBuyer(purcode);
     PageInfo<Map> pageInfo=new PageInfo<Map>(maps);
     return pageInfo;
 }

 public PageInfo getCaiwu(Integer pageNum, String purcode){
     PageHelper.startPage(pageNum,2);
     List<Map> maps = buyerMapper.getCaiwu(purcode);
     PageInfo<Map> pageInfo=new PageInfo<Map>(maps);
     return pageInfo;
 }
 public void update(@Param("array") String [] ids){
        buyerMapper.update(ids);
    }

    public void updateBuyer(@Param("array") String [] ids){
        buyerMapper.updateBuyer(ids);
    }
    public void updateCaiwu(@Param("array") String [] ids){
        buyerMapper.updateCaiwu(ids);
    }
}
